﻿Imports System.IO
Public Class frmJanpanEMS
    Dim CheckBar As New CheckCode
    Private Sub frmJanpanEMS_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Btn_Create_Click(sender As Object, e As EventArgs) Handles Btn_Create.Click
        Dim StartNo As Long = 28558801
        Dim EndNo As Long = 28838800
        Dim fs As FileStream = New FileStream("E:\1.TXT", FileMode.Create)
        Dim fw As New StreamWriter(fs, System.Text.Encoding.Default)
        Dim sIndex As Long = 0
        For i = StartNo To EndNo Step 1
            Dim tmpW As String = "EJ" + i.ToString() + CheckBar.ModEleven(i.ToString) + "JP"
            Dim LineTwo As String = Form1.InsertChar("*" + tmpW + "*", "   ")
            fw.WriteLine(tmpW)
            fw.WriteLine(LineTwo)
            sIndex += 1
            If sIndex Mod 50000 = 0 And sIndex > 0 Then
                For j = 1 To 500
                    fw.WriteLine("EJ" + FormatByLength(j, 9) + "JP")
                    fw.WriteLine(Form1.InsertChar("*EJ" + FormatByLength(j, 9) + "JP*", "   "))
                Next
            End If
            Me.Text = Strings.Format(sIndex / (EndNo - StartNo + 1) * 100, "00") & "%"
            My.Application.DoEvents()
        Next
        fw.Close()
        fs.Close()
    End Sub
  
End Class